package com.apobates.forum.core.impl.event;

import com.apobates.forum.core.entity.Topic;
import com.apobates.forum.core.entity.TopicConfig;
import com.apobates.forum.event.elderly.ActionEventCulpritor;
import com.apobates.forum.event.elderly.ForumActionEnum;

/**
 * 插件类话题发布事件
 * 
 * @author xiaofanku
 * @since 20200530
 */
public class PlugTopicPublishEvent {
    private static final long serialVersionUID = 1L;
    private final Topic plugTopic;
    private final TopicConfig plugConfig;
    private final long plugContent; //话题的内容(PostsID)
    private final long member;
    private final String nickname;
    private final String token;
    private final String ipAddr;
    //什么动作生成的插件话题
    //反馈,投拆话题(,回复)
    private final ForumActionEnum action;
    
    public PlugTopicPublishEvent(Topic plugTopic, TopicConfig plugConfig, long plugContent, ForumActionEnum action, ActionEventCulpritor culpritor) {
        this.plugTopic = plugTopic;
        this.plugConfig = plugConfig;
        this.plugContent = plugContent;
        this.action = action;
        this.member = culpritor.getMemberId();
        this.nickname = culpritor.getMemberNickname();
        this.token = culpritor.getToken();
        this.ipAddr = culpritor.getIpAddr();
    }

    public long getPlugContent() {
        return plugContent;
    }

    public TopicConfig getPlugConfig() {
        return plugConfig;
    }

    public Topic getPlugTopic() {
        return plugTopic;
    }
    
    public ForumActionEnum getAction() {
        return action;
    }

    public long getMember() {
        return member;
    }

    public String getNickname() {
        return nickname;
    }

    public String getToken() {
        return token;
    }

    public String getIpAddr() {
        return ipAddr;
    }
}